package com.liy.jagou.auth.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 *
 *
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping("/sayHello")
    public String sayHello(HttpServletRequest request, HttpServletResponse response) {

        String userInfo = request.getHeader("userInfo");

        System.out.println( userInfo );

        return userInfo;
    }

    @GetMapping("/sayHi")
    public String sayHi(@RequestHeader("userId") String userId) {
        return userId;
    }

}
